<?php

use yii\db\Schema;
use yii\db\Migration;

class m150618_072803_advertiser_map extends Migration
{
        public function up()
    {
    	$sql = <<<FINE
DROP TABLE IF EXISTS {{%advertiser_map}};
CREATE TABLE {{%advertiser_map}} (
  id int(11) unsigned NOT NULL AUTO_INCREMENT,
  vam_advertiser_id varchar(64) NOT NULL COMMENT '广告主在所属sl中的唯一标注id',
  name varchar(128) NOT NULL COMMENT '广告主名称',
  ad_network_id int(10) NOT NULL COMMENT '广告主所属ssp',
  advertiser_id varchar(64) NOT NULL COMMENT '广告主在所属ssp中的标注id',
  status tinyint(1) NOT NULL DEFAULT '1' COMMENT '0无效，1有效',
  last_update timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (id)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
FINE;
	$this->execute($sql);
    }

    public function down()
    {
        $sql = <<<FINE
        DROP TABLE IF EXISTS {{%advertiser_map}};
FINE;
		$this->execute($sql);
    }
}
